﻿// ***********************************************************************
// Assembly         : Logica
// Author           : Diego
// Created          : 03-02-2014
//
// Last Modified By : Diego
// Last Modified On : 03-02-2014
// ***********************************************************************
// <copyright file="LOG_Perfiles.cs" company="">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using AccesoDatos.Modulos.ClasesAccesoDatos;
using Modelado.Modulos.ClasesModelado;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/// <summary>
/// The ClasesLogica namespace.
/// </summary>
namespace Logica.Modulos.ClasesLogica
{
    /// <summary>
    /// Class LOG_Perfiles.
    /// </summary>
   public class LOG_Perfiles:Negocio
    {

        //insertar Perfil
        /// <summary>
        /// Crs the e_ perfil.
        /// </summary>
        /// <param name="obj">The object.</param>
        public void CRE_Perfil(MOD_Perfiles obj)
        {
            try
            {
                this.IniciarTransaccion();

                AD_Perfiles objBD = new AD_Perfiles();

                objBD.CRE_Perfil(this.comando, obj);

                this.ConfirmarTransaccion();
            }
            catch (Exception exc)
            {
                this.DeshacerTransaccion();
                throw exc;
            }
        }


        //Elimina Perfil

        /// <summary>
        /// Des the l_ perfil.
        /// </summary>
        /// <param name="obj">The object.</param>
        public void DEL_Perfil(MOD_Perfiles obj)
        {
            try
            {
                this.IniciarTransaccion();

                AD_Perfiles objBD = new AD_Perfiles();

                objBD.DEL_Perfil(this.comando, obj);

                this.ConfirmarTransaccion();
            }
            catch (Exception exc)
            {
                this.DeshacerTransaccion();
                throw exc;
            }
        }

        //Actualiza Perfil
        /// <summary>
        /// Ups the d_ perfil.
        /// </summary>
        /// <param name="obj">The object.</param>
        public void UPD_Perfil(MOD_Perfiles obj)
        {
            try
            {
                this.IniciarTransaccion();

                AD_Perfiles objBD = new AD_Perfiles();

                objBD.UPD_Perfil(this.comando, obj);

                this.ConfirmarTransaccion();
            }
            catch (Exception exc)
            {
                this.DeshacerTransaccion();
                throw exc;
            }

        }

        //consultar grid Perfiles

        /// <summary>
        /// Ses the l_ grid_ perfiles.
        /// </summary>
        /// <returns>List{MOD_Perfiles}.</returns>
        public List<MOD_Perfiles> SEL_Grid_Perfiles()
        {
            try
            {
                this.AbrirConexion();

                AD_Perfiles objBD = new AD_Perfiles();

                List<MOD_Perfiles> lista = objBD.SEL_Grid_Perfiles(this.comando);

                this.CerrarConexion();

                return lista;
            }
            catch (Exception exc)
            {
                this.CerrarConexion();
                throw exc;
            }
        }

        //Seleccionar Perfile by id
        /// <summary>
        /// Ses the l_ perfil by identifier.
        /// </summary>
        /// <param name="USU_CODPerfil">The us u_ cod perfil.</param>
        /// <returns>MOD_Perfiles.</returns>
        public MOD_Perfiles SEL_PerfilByID(int USU_CODPerfil)
        {
            try
            {
                this.AbrirConexion();

                AD_Perfiles objBD = new AD_Perfiles();

                MOD_Perfiles objPerfil = objBD.SEL_PerfilByID(this.comando, USU_CODPerfil);

                this.CerrarConexion();

                return objPerfil;
            }
            catch (Exception exc)
            {
                this.CerrarConexion();
                throw exc;
            }

        }

    }
}
